If InStr(txtFileName.Text, "\") <> 0 Or InStr(txtFileName.Text, ":") <> 0 Then
MsgBox "Enter filename only. Use the file controls provided to select the proper drive and directory.", OK + WARNINGQUERY + FIRSTBUTTON, "Invalid Filename"
Else
'Build correct path and filename for fname
fname = Dir1.Path
If Right$(fname, 1) <> "\" Then fname = fname + "\"
fname = fname + txtFileName.Text
'Append a .txt extension
If Right$(fname, 4) <> "." Then fname = fname + ".txt"
'Unload the SAVEAS.FRM
Unload frmSaveAs
End If
End Sub
Sub Dir1_Change ()
'Update the machine's current directory
ChDir (Dir1.Path)
'Update the label caption
lblPath.Caption = Dir1.Path
End Sub
Sub Drive1_Change ()
Dim rc As Integer
'Set the drive error trap
On Error GoTo SaveDriveError
'Update the directory list
Dir1.Path = Drive1.Drive
'Unset the drive error trap
On Error GoTo 0
Exit Sub
SaveDriveError:
'Debug logic
MsgBox "The error is: " + Str$(Err) + " " + Error$